import request from '@/utils/request'
import type { addLeave } from '@/model'
export const getLeave = () => request.get('/getLeave')
export const AddLeave = (ruleForm: addLeave) =>
  request.post('/addLeave', JSON.stringify(ruleForm), {
    headers: {
      'Content-Type': 'application/json'
    }
  })
export const UpdateLeave = (ruleForm: addLeave) =>
  request.post('/updateLeave', JSON.stringify(ruleForm), {
    headers: {
      'Content-Type': 'application/json'
    }
  })
export const deleteLeave = (id: number) =>
  request.get(`/deleteLeave/${id}`)
// export const deleteLeave = (id: number) =>
//   request.delete('/deleteLeave', {
//     data: id, // 直接发送数字
//     headers: {
//       'Content-Type': 'application/json'
//     }
//   })
